﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;

namespace cpu3
{
    class Program
    {
        static void Main(string[] args)
        {
            cpu3(0.5);
        }
        static void cpu3(double level)
        {
            PerformanceCounter p = new PerformanceCounter("Processor", "% Processor Time", "_Total");
            if (p == null)
            { return; }
            while(true)
            {
                if(p.NextValue() > level)
                    System.Threading.Thread.Sleep(10);  

            }
        }
    }
}
